def cola_supplement(stock, *args):
    """
    计算每种可乐需要补充的数量
    :param stock: 初始库存，字典格式，如 {"可口可乐": 10, "百事可乐": 2, "零度可乐": 0, "芬达": 6, "健怡可乐": 4}
    :param args: 每位客人可能喝的可乐品牌集合，如 p1, p2, p3, p4, p5
    :return: 需要补充的可乐数量，字典格式
    """
    # 统计每种可乐被客人选中的次数
    need_count = {}
    for p in args:
        for cola in p:
            if cola not in need_count:
                need_count[cola] = 1
            else:
                need_count[cola] += 1

    # 计算每种可乐需要补充的数量
    supplement = {}
    for cola, need in need_count.items():
        if stock[cola] < need:
            supplement[cola] = need - stock[cola]

    return supplement


if __name__ == '__main__':
    # 初始库存
    initial_stock = {"可口可乐": 10, "百事可乐": 2, "零度可乐": 0, "芬达": 6, "健怡可乐": 4}

    # 每位客人可能喝的可乐品牌
    p1 = {"可口可乐", "零度可乐", "芬达", "健怡可乐"}
    p2 = {"百事可乐", "零度可乐", "健怡可乐"}
    p3 = {"可口可乐", "百事可乐", "芬达"}
    p4 = {"零度可乐", "芬达", "健怡可乐"}
    p5 = {"可口可乐", "百事可乐", "健怡可乐"}

    # 调用函数并打印结果
    result = cola_supplement(initial_stock, p1, p2, p3, p4, p5)
    print("需要补充的可乐有：", result)